package com.yellowpage.bigdata.action;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import javax.servlet.http.HttpServletResponse;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.yellowpage.bigdata.data.NspOnofflogImeiDayregionSum;
import com.yellowpage.bigdata.service.AutoMailUserServiceImpl;
import com.yellowpage.bigdata.service.NspFatallogRequsetSumService;
import com.yellowpage.bigdata.service.NspOnofflogImeiDayregionSumService;
import com.yellowpage.ca.data.User;
import com.yellowpage.ca.service.RegionService;
import com.yellowpage.mail.bean.MailBean;
import com.yellowpage.mail.service.MailSendService;
import com.yellowpage.nsp.listener.SynchroDataTimerTask;
import com.yellowpage.white.common.Configuration;
import com.yellowpage.white.exception.MailSendException;
import com.yellowpage.white.struts.BaseAction;

public class NspOnofflogImeiDayregionAction extends BaseAction {

	public String RESULT_QUERY = "query";
	public String RESULT_ADD = "add";
	public String RESULT_EDIT = "edit";

	private Configuration configuration;

	public void setConfiguration(Configuration configuration) {
		this.configuration = configuration;
	}

	private List<NspOnofflogImeiDayregionSum> nspOnofflogImeiDayregionSumList = new ArrayList<NspOnofflogImeiDayregionSum>();
	private List<Map> resultList = new ArrayList<Map>();

	private NspOnofflogImeiDayregionSum nspOnofflogImeiDayregionSum;
	private NspOnofflogImeiDayregionSumService nspOnofflogImeiDayregionSumService;
	private NspFatallogRequsetSumService nspFatallogRequsetSumService;
	public NspFatallogRequsetSumService getNspFatallogRequsetSumService() {
		return nspFatallogRequsetSumService;
	}
	public void setNspFatallogRequsetSumService(
			NspFatallogRequsetSumService nspFatallogRequsetSumService) {
		this.nspFatallogRequsetSumService = nspFatallogRequsetSumService;
	}

	private String selectedId;
	private String[] selectedIds;
	private String message;

	private String query_note;
	private String query_createTime;
	private String query_onofflogImeiDayregionSumId;
	private String query_imeiDayCount;
	private String query_imeiAllCount;
	private String query_imeiNewCount;
	private String query_logDate;
	private String query_regionCode;
	private String query_optType;
	private String query_createUser;
	private String query_logDate_end;
	private RegionService regionService;
	private MailSendService mailSendService;
	private String regionName;
	private Map<String, String> regionMap;
	public Map<String, String> getRegionMap() {
		return regionMap;
	}
	public void setRegionMap(Map<String, String> regionMap) {
		this.regionMap = regionMap;
	}
	public String getRegionName() {
		return regionName;
	}

	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}
	public RegionService getRegionService() {
		return regionService;
	}

	public void setRegionService(RegionService regionService) {
		this.regionService = regionService;
	}
    public String getRegionSql(){
    	  Map session = ActionContext.getContext().getSession();
    	  User user = (User) session.get("userObject");
    	  String function_code= "OMC_CLIENT_LOG_COUNT_DAY_REGIONCOUNT";
    	  String regionsql= regionService.getRegionclauseByUserFunction(user.getUserId(), function_code, "REGION_CODE");
    	 return regionsql;
    }
	public void prepare() {
		super.prepare();

		if (this.selectedId != null && !this.selectedId.equals("")) {
			this.nspOnofflogImeiDayregionSum = nspOnofflogImeiDayregionSumService
					.getNspOnofflogImeiDayregionSum(Long.parseLong(selectedId));
		}
	}
	public String queryChannel(){
		initPageRender();
		regionMap = nspFatallogRequsetSumService.getRegionMap(getRegionSql());
		setPageRenderToRequest();
		return "toRegion";
	}
	public String queryByPage() {
		initPageRender();

		Map queryMap = new HashMap();
		if(!regionName.equals("")){
			regionMap = nspFatallogRequsetSumService.getRegionMap(getRegionSql());
			String[] val = regionName.split(";");
			String str = "(";
			for(String ss : val){
				if("A".equals(ss)){
					for(String key : regionMap.keySet()){
						if(key.equals("000000")){
    						str += "'" + ss + "',";
    						break;
    					}
					}
					continue;
				}
				for(String key : regionMap.keySet()){
					if(regionMap.get(key).contains(ss)||key.equals(ss)){
						str += "'" + key + "',";
						break;
					}
				}
			}
			str= str.substring(0, str.length() - 1)+")";
			if(")".equals(str)){
				return RESULT_QUERY;
			}
			queryMap.put("regionCode", str);
		}else{
			queryMap.put("regionCode", "");
			queryMap.put("regionCode1", getRegionSql());
			}
		queryMap.put("logDate", query_logDate);
		queryMap.put("query_logDate_end", query_logDate_end);

		resultList = nspOnofflogImeiDayregionSumService
				.queryNspOnofflogImeiDayregionByPage(queryMap, pageRender);

		setPageRenderToRequest();

		return RESULT_QUERY;
	}
	
	public String queryAll() {
		initPageRender();

		if(query_regionCode == null)
			return "queryAll";
		
		Map queryMap = new HashMap();
		queryMap.put("logDate", query_logDate);
		queryMap.put("regionCode", query_regionCode);
		queryMap.put("query_logDate_end", query_logDate_end);

		resultList = nspOnofflogImeiDayregionSumService
				.queryNspOnofflogImeiDayregionByPageAll(queryMap, pageRender);

		setPageRenderToRequest();

		return "queryAll";
	}
	public String  exportExcel2MailByCondition() {
		initPageRender();
		Map queryMap = new HashMap();
		/*Calendar calendar = new GregorianCalendar();  
		 calendar.set(Calendar.DAY_OF_MONTH, 1);  
	     Date time = calendar.getTime();
	     String date = new SimpleDateFormat("yyyyMMdd").format(time);*/
	     Date time =new Date();
	     String date = new SimpleDateFormat("yyyy-MM-dd").format(time);
		queryMap.put("logDate", query_logDate);
		queryMap.put("regionCode", "A");
		queryMap.put("query_logDate_end", query_logDate_end);
		resultList = nspOnofflogImeiDayregionSumService
				.queryNspOnofflogImeiDayregionByPageAll(queryMap);
		//windows 下的测试环境
		InputStream input = AutoMailUserServiceImpl.class.getClassLoader().getResourceAsStream("/constants.properties");
        Properties prop=new Properties();
        try {
			prop.load(input);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        String doc = prop.getProperty("MAIL_FOLDER");
        String excelFile=doc+"/客户端统计_"+date+".xls";
		//liunx 下的测试环境
		 //  String excelFile="/xx/xx/客户端统计_"+date+".xls";  
		 
		 
	     FileOutputStream outp = null;
		try {
			outp = new FileOutputStream(excelFile);
		} catch (FileNotFoundException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}  
		try {
			//outp = response.getOutputStream();
			HSSFWorkbook workbook = new HSSFWorkbook();
			HSSFSheet sheet = workbook.createSheet("ImeiRegionAll");
			sheet.autoSizeColumn(1);
			HSSFCellStyle cellStyle = workbook.createCellStyle(); //单元格格式
			cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); //设置右边框
			cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中

			HSSFRow row1 = sheet.createRow(0);// 二级标题栏
			String[] title = {"日期 ","活跃数","主动活跃数","被动（来显）","Android","IOS","累计用户数 ","新增数 "};
			for(int i = 0 ,len = title.length;i<len;i++){
				HSSFCell cell = row1.createCell(i);
				cell.setCellValue(title[i]);
			}
			for (int i = 0, len = resultList.size(); i < len; i++) {
				HSSFRow data_row = sheet.createRow(i + 1);
				Map result = resultList.get(i);
				data_row.createCell(0).setCellValue(
						result.get("LOG_DATE") != null ? result.get(
								"LOG_DATE").toString() : "");
				data_row.createCell(1).setCellValue(
						result.get("JHNUM") != null ? result.get("JHNUM")
								.toString() : "");
				data_row.createCell(2).setCellValue(
						result.get("ZDNUM") != null ? result.get("ZDNUM")
								.toString() : "");
				data_row.createCell(3).setCellValue(
						result.get("LXNUM") != null ? result.get("LXNUM")
								.toString() : "");
				data_row.createCell(4).setCellValue(
						result.get("ANDROIDNUM") != null ? result.get(
								"ANDROIDNUM").toString() : "");
				data_row.createCell(5).setCellValue(
						result.get("IOSNUM") != null ? result.get(
								"IOSNUM").toString() : "");
				data_row.createCell(6).setCellValue(
						result.get("ALLNUM") != null ? result.get(
								"ALLNUM").toString() : "");
				data_row.createCell(7).setCellValue(
						result.get("NEWNUM") != null ? result.get(
								"NEWNUM").toString() : "");
			}
			workbook.write(outp);
			//response.flushBuffer();
			outp.flush();
			//response.reset();
			InputStream in = SynchroDataTimerTask.class.getClassLoader().getResourceAsStream("/mail.properties");
	        Properties props=new Properties();
	        props.load(in);
	        in.close(); 
			
			MailBean mail=new MailBean();
			mail.setUserName(props.getProperty("mail.userName"));
			mail.setPassWord(props.getProperty("mail.password"));
			
			
			mail.setFrom(props.getProperty("mail.from"));
			String mess="";
			if(query_logDate_end.equals(" ")||query_logDate_end==null||query_logDate_end.length()==0){
				if(query_logDate.equals(" ")||query_logDate==null||query_logDate.length()==0){
					mess="日用户统计总览;	统计周期: 全部数据;    详情见附件";
				}else{
					mess="附件为:"+query_logDate+" 日 至 昨日   的客户端统计结果文件，请查收，谢谢";
				}
				
			}else{
				if(query_logDate.equals(" ")||query_logDate==null||query_logDate.length()==0){
					mess="日用户统计总览;	统计周期: 今天以前的全部数据;    详情见附件";
				}else{
					mess="附件为:"+query_logDate+" 日至"+query_logDate_end+" 日的客户端统计结果文件，请查收，谢谢";
				}
				
			}
			mail.setMessage(mess);
			mail.setSubject("客户端统计结果文件_"+date);
			List<String> userList = AutoMailUserServiceImpl.getUserList();
	        String to="";
	        for (String string : userList) {
				to+=string+";";
			}
			mail.setTo(to);
			List<String> attachmentList=new ArrayList<String>();
			attachmentList.add(excelFile);
			mail.setAttachmentList(attachmentList);
			//mail.setCc("szhou@guanghua.sh.cn");
			//mail.setBcc("szhou@guangua.sh.cn");
			try {
				mailSendService.sendMail(mail);
			} catch (MailSendException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			
		} catch (Exception e) {
			log.error(e.getMessage(), e);
			e.printStackTrace();
			this.addActionError("** 生成文件错误 !");
		}finally {
			if (outp != null) {
				try {
					outp.close();
				} catch (IOException e) {
					log.error(e.getMessage(), e);
				}
			}
			File file = new File(excelFile);
			file.delete();
		}
		
		setPageRenderToRequest();
		return "queryAll";
	}
	public void exportExcel() {
//		Map queryMap = new HashMap();
//		queryMap.put("logDate", query_logDate);
//		queryMap.put("regionCode", query_regionCode);
//		queryMap.put("query_logDate_end", query_logDate_end);
		Map queryMap = new HashMap();
		queryMap.put("logDate", query_logDate);
		if (!regionName.equals("")) {
			regionMap = nspFatallogRequsetSumService.getRegionMap(getRegionSql());
			String[] val = regionName.split(";");
			String str = "(";
			for (String ss : val) {
				if("A".equals(ss)){
					for(String key : regionMap.keySet()){
						if(key.equals("000000")){
    						str += "'" + ss + "',";
    						break;
    					}
					}
					continue;
				}
				for (String key : regionMap.keySet()) {
					if (regionMap.get(key).contains(ss)) {
						str += "'" + key + "',";
						break;
					}
				}
			}
			str= str.substring(0, str.length() - 1)+")";
			if(")".equals(str)){
				resultList = null;
			}else{
				queryMap.put("regionCode", str);
			}
		} else {
			queryMap.put("regionCode", "");
			queryMap.put("regionCode1", getRegionSql());
			}
		queryMap.put("query_logDate_end", query_logDate_end);
		
		if(resultList !=null){
			
			resultList = nspOnofflogImeiDayregionSumService
					.queryNspOnofflogImeiDayregionByPage(queryMap);
		}
		HttpServletResponse response = ServletActionContext.getResponse();
		response.setContentType("application/x-download");
		OutputStream outp = null;
		response.addHeader("Content-Disposition", "attachment;filename="
				+ "ImeiDayRegion.xls");
		try {
			outp = response.getOutputStream();
			HSSFWorkbook workbook = new HSSFWorkbook();
			HSSFSheet sheet = workbook.createSheet("ImeiDayRegion");
			sheet.autoSizeColumn(1);
			HSSFCellStyle cellStyle = workbook.createCellStyle(); //单元格格式
			cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); //设置右边框
			cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
//			HSSFRow row = sheet.createRow(0);// 一级标题栏
//			sheet.addMergedRegion(new CellRangeAddress(0, 0, 0,  3));
//			row.createCell(0).setCellValue(" ");
//			sheet.addMergedRegion(new CellRangeAddress(0,  0, 4, 5));
//			HSSFCell cell0 = row.createCell(4);
//			cell0.setCellStyle(cellStyle);
//			cell0.setCellValue("运营商");
//			sheet.addMergedRegion(new CellRangeAddress(0, 0, 6, 7));
//		    cell0= row.createCell(7);
//			cell0.setCellValue("系统");
//			sheet.addMergedRegion(new CellRangeAddress(0, 0, 8, 9));
//			row.createCell(6).setCellValue(" ");
			HSSFRow row1 = sheet.createRow(0);// 二级标题栏
			String[] title = {"地区代码","地区名称","日期 ","新增数 ","活跃数","主动活跃数","被动（来显）","累计用户数 "};
			for(int i = 0 ,len = title.length;i<len;i++){
				HSSFCell cell = row1.createCell(i);
				cell.setCellValue(title[i]);
			}
			for (int i = 0, len = resultList.size(); i < len; i++) {
				HSSFRow data_row = sheet.createRow(i + 1);
				Map result = resultList.get(i);
				data_row.createCell(0).setCellValue(
						result.get("REGION_CODE") != null ? result.get(
								"REGION_CODE").toString() : "");
				data_row.createCell(1).setCellValue(
						result.get("REGION_NAME") != null ? result.get(
								"REGION_NAME").toString() : "");
				data_row.createCell(2).setCellValue(
						result.get("LOG_DATE") != null ? result.get(
								"LOG_DATE").toString() : "");
				data_row.createCell(3).setCellValue(
						result.get("NEWNUM") != null ? result.get(
								"NEWNUM").toString() : "");
				data_row.createCell(4).setCellValue(
						result.get("JHNUM") != null ? result.get("JHNUM")
								.toString() : "");
				data_row.createCell(5).setCellValue(
						result.get("ZDNUM") != null ? result.get("ZDNUM")
								.toString() : "");
				data_row.createCell(6).setCellValue(
						result.get("LXNUM") != null ? result.get("LXNUM")
								.toString() : "");
				data_row.createCell(7).setCellValue(
						result.get("ALLNUM") != null ? result.get(
								"ALLNUM").toString() : "");
			}
			workbook.write(outp);
			response.flushBuffer();
			outp.flush();
			response.reset();
		} catch (Exception e) {
			log.error(e.getMessage(), e);
			this.addActionError("** 生成文件错误 !");
		}finally {
			if (outp != null) {
				try {
					outp.close();
				} catch (IOException e) {
					log.error(e.getMessage(), e);
				}
			}
		}
	}
	
	public void exportAllExcel() {
		Map queryMap = new HashMap();
		queryMap.put("logDate", query_logDate);
		queryMap.put("regionCode", "A");
		queryMap.put("query_logDate_end", query_logDate_end);
		resultList = nspOnofflogImeiDayregionSumService
				.queryNspOnofflogImeiDayregionByPageAll(queryMap);
		HttpServletResponse response = ServletActionContext.getResponse();
		response.setContentType("application/x-download");
		OutputStream outp = null;
		response.addHeader("Content-Disposition", "attachment;filename="
				+ "ImeiRegionAll.xls");
		try {
			outp = response.getOutputStream();
			HSSFWorkbook workbook = new HSSFWorkbook();
			HSSFSheet sheet = workbook.createSheet("ImeiRegionAll");
			sheet.autoSizeColumn(1);
			HSSFCellStyle cellStyle = workbook.createCellStyle(); //单元格格式
			cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); //设置右边框
			cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中
//			HSSFRow row = sheet.createRow(0);// 一级标题栏
//			sheet.addMergedRegion(new CellRangeAddress(0, 0, 0,  3));
//			row.createCell(0).setCellValue(" ");
//			sheet.addMergedRegion(new CellRangeAddress(0,  0, 4, 5));
//			HSSFCell cell0 = row.createCell(4);
//			cell0.setCellStyle(cellStyle);
//			cell0.setCellValue("运营商");
//			sheet.addMergedRegion(new CellRangeAddress(0, 0, 6, 7));
//		    cell0= row.createCell(7);
//			cell0.setCellValue("系统");
//			sheet.addMergedRegion(new CellRangeAddress(0, 0, 8, 9));
//			row.createCell(6).setCellValue(" ");
			HSSFRow row1 = sheet.createRow(0);// 二级标题栏
			String[] title = {"日期 ","活跃数","主动活跃数","被动（来显）","Android","IOS","累计用户数 ","新增数 "};
			for(int i = 0 ,len = title.length;i<len;i++){
				HSSFCell cell = row1.createCell(i);
				cell.setCellValue(title[i]);
			}
			for (int i = 0, len = resultList.size(); i < len; i++) {
				HSSFRow data_row = sheet.createRow(i + 1);
				Map result = resultList.get(i);
				data_row.createCell(0).setCellValue(
						result.get("LOG_DATE") != null ? result.get(
								"LOG_DATE").toString() : "");
				data_row.createCell(1).setCellValue(
						result.get("JHNUM") != null ? result.get("JHNUM")
								.toString() : "");
				data_row.createCell(2).setCellValue(
						result.get("ZDNUM") != null ? result.get("ZDNUM")
								.toString() : "");
				data_row.createCell(3).setCellValue(
						result.get("LXNUM") != null ? result.get("LXNUM")
								.toString() : "");
				data_row.createCell(4).setCellValue(
						result.get("ANDROIDNUM") != null ? result.get(
								"ANDROIDNUM").toString() : "");
				data_row.createCell(5).setCellValue(
						result.get("IOSNUM") != null ? result.get(
								"IOSNUM").toString() : "");
				data_row.createCell(6).setCellValue(
						result.get("ALLNUM") != null ? result.get(
								"ALLNUM").toString() : "");
				data_row.createCell(7).setCellValue(
						result.get("NEWNUM") != null ? result.get(
								"NEWNUM").toString() : "");
			}
			workbook.write(outp);
			response.flushBuffer();
			outp.flush();
			response.reset();
		} catch (Exception e) {
			log.error(e.getMessage(), e);
			this.addActionError("** 生成文件错误 !");
		}finally {
			if (outp != null) {
				try {
					outp.close();
				} catch (IOException e) {
					log.error(e.getMessage(), e);
				}
			}
		}
	}

	public String toAdd() {
		return RESULT_ADD;
	}

	public String save() {

		nspOnofflogImeiDayregionSumService
				.saveNspOnofflogImeiDayregionSum(nspOnofflogImeiDayregionSum);

		message = "新增成功!";
		return RESULT_ADD;
	}

	public void validateSave() {
		if (nspOnofflogImeiDayregionSum.getNote().length() == 0) {
			this.addActionError("** Note 不能为空 !");
		}
		if (nspOnofflogImeiDayregionSum.getLogDate().length() == 0) {
			this.addActionError("** LogDate 不能为空 !");
		}
		if (nspOnofflogImeiDayregionSum.getRegionCode().length() == 0) {
			this.addActionError("** RegionCode 不能为空 !");
		}
		if (nspOnofflogImeiDayregionSum.getOptType().length() == 0) {
			this.addActionError("** OptType 不能为空 !");
		}

		this.setValidatorResult("/bigdata/NspOnofflogImeiDayregionSumAdd.jsp");
	}

	public String toEdit() {
		Long id = new Long(selectedId);

		nspOnofflogImeiDayregionSum = nspOnofflogImeiDayregionSumService
				.getNspOnofflogImeiDayregionSum(id);

		return RESULT_EDIT;
	}

	public String update() {

		nspOnofflogImeiDayregionSumService
				.updateNspOnofflogImeiDayregionSum(nspOnofflogImeiDayregionSum);

		message = "修改成功!";

		return RESULT_EDIT;
	}

	public void validateUpdate() {
		if (nspOnofflogImeiDayregionSum.getNote().length() == 0) {
			this.addActionError("** Note 不能为空 !");
		}
		if (nspOnofflogImeiDayregionSum.getLogDate().length() == 0) {
			this.addActionError("** LogDate 不能为空 !");
		}
		if (nspOnofflogImeiDayregionSum.getRegionCode().length() == 0) {
			this.addActionError("** RegionCode 不能为空 !");
		}
		if (nspOnofflogImeiDayregionSum.getOptType().length() == 0) {
			this.addActionError("** OptType 不能为空 !");
		}
		this.setValidatorResult("/bigdata/NspOnofflogImeiDayregionSumUpdate.jsp");
	}

	public String delete() {
		List ids = new ArrayList();

		for (String id : selectedIds) {
			ids.add(Long.valueOf(id));
		}

		try {
			this.nspOnofflogImeiDayregionSumService.delete(ids);
		} catch (Exception e) {
			System.out.println("异常....");
			this.addActionError("** 可能含有子记录约束冲突删除失败 !");
		}

		return queryByPage();
	}

	/**
	 * getters and setters
	 * 
	 * @return
	 */
	public void setNspOnofflogImeiDayregionSum(
			NspOnofflogImeiDayregionSum nspOnofflogImeiDayregionSum) {
		this.nspOnofflogImeiDayregionSum = nspOnofflogImeiDayregionSum;
	}

	public NspOnofflogImeiDayregionSum getNspOnofflogImeiDayregionSum() {
		return nspOnofflogImeiDayregionSum;
	}

	public void setNspOnofflogImeiDayregionSumService(
			NspOnofflogImeiDayregionSumService nspOnofflogImeiDayregionSumService) {
		this.nspOnofflogImeiDayregionSumService = nspOnofflogImeiDayregionSumService;
	}

	public List<NspOnofflogImeiDayregionSum> getNspOnofflogImeiDayregionSumList() {
		return nspOnofflogImeiDayregionSumList;
	}

	public void setNspOnofflogImeiDayregionSumList(
			List<NspOnofflogImeiDayregionSum> nspOnofflogImeiDayregionSumList) {
		this.nspOnofflogImeiDayregionSumList = nspOnofflogImeiDayregionSumList;
	}

	public String getSelectedId() {
		return selectedId;
	}

	public void setSelectedId(String selectedId) {
		this.selectedId = selectedId;
	}

	public String[] getSelectedIds() {
		return selectedIds;
	}

	public void setSelectedIds(String[] selectedIds) {
		this.selectedIds = selectedIds;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public List<Map> getResultList() {
		return resultList;
	}

	public void setResultList(List<Map> resultList) {
		this.resultList = resultList;
	}

	public String getQuery_note() {
		return this.query_note;
	}

	public void setQuery_note(String note) {
		this.query_note = note;
	}

	public String getQuery_createTime() {
		return this.query_createTime;
	}

	public void setQuery_createTime(String createTime) {
		this.query_createTime = createTime;
	}

	public String getQuery_onofflogImeiDayregionSumId() {
		return this.query_onofflogImeiDayregionSumId;
	}

	public void setQuery_onofflogImeiDayregionSumId(
			String onofflogImeiDayregionSumId) {
		this.query_onofflogImeiDayregionSumId = onofflogImeiDayregionSumId;
	}

	public String getQuery_imeiDayCount() {
		return this.query_imeiDayCount;
	}

	public void setQuery_imeiDayCount(String imeiDayCount) {
		this.query_imeiDayCount = imeiDayCount;
	}

	public String getQuery_imeiAllCount() {
		return this.query_imeiAllCount;
	}

	public void setQuery_imeiAllCount(String imeiAllCount) {
		this.query_imeiAllCount = imeiAllCount;
	}

	public String getQuery_imeiNewCount() {
		return this.query_imeiNewCount;
	}

	public void setQuery_imeiNewCount(String imeiNewCount) {
		this.query_imeiNewCount = imeiNewCount;
	}

	public String getQuery_logDate() {
		return this.query_logDate;
	}

	public void setQuery_logDate(String logDate) {
		this.query_logDate = logDate;
	}

	public String getQuery_regionCode() {
		return this.query_regionCode;
	}

	public void setQuery_regionCode(String regionCode) {
		this.query_regionCode = regionCode;
	}

	public String getQuery_optType() {
		return this.query_optType;
	}

	public void setQuery_optType(String optType) {
		this.query_optType = optType;
	}

	public String getQuery_createUser() {
		return this.query_createUser;
	}

	public void setQuery_createUser(String createUser) {
		this.query_createUser = createUser;
	}

	public String getQuery_logDate_end() {
		return query_logDate_end;
	}

	public void setQuery_logDate_end(String query_logDate_end) {
		this.query_logDate_end = query_logDate_end;
	}
	public NspOnofflogImeiDayregionSumService getNspOnofflogImeiDayregionSumService() {
		return nspOnofflogImeiDayregionSumService;
	}
	public MailSendService getMailSendService() {
		return mailSendService;
	}
	public void setMailSendService(MailSendService mailSendService) {
		this.mailSendService = mailSendService;
	}

}
